<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变色菜单</title>
<style>
    ul{
        list-style: none;
        display: flex;
        width: 100%;
    }
    ul li{
        margin: 50px 30px;
        color: white;
        font-size: 26px;
        font-weight: bold;
        text-align: center;
        line-height: 50px;
        background-repeat: no-repeat;
        width: 120px;
        height: 58px;
    }
    ul li:nth-child(1){
        background-image: url(./img/bg1.png);
    }
    ul li:nth-child(2){
        background-image: url(./img/bg2.png);
    }
    ul li:nth-child(3){
        background-image: url(./img/bg3.png);
    }
    ul li:nth-child(4){
        background-image: url(./img/bg4.png);
    }
    ul li:nth-child(1):hover{
        background-image: url(./img/bg5.png);
    }
    ul li:nth-child(2):hover{
        background-image: url(./img/bg6.png);
    }
    ul li:nth-child(3):hover{
        background-image: url(./img/bg7.png);
    }
    ul li:nth-child(4):hover{
        background-image: url(./img/bg3.jpg);
    }
</style>
</head>
<body>
    <div>
        <ul>
            <li>菜单一</li>
            <li>菜单二</li>
            <li>菜单三</li>
            <li>菜单四</li>
        </ul>


    </div>
    
</body>
</html>